<?php

declare(strict_types=1);

use App\Http\Controllers\Home;
use Illuminate\Support\Facades\Route;

Route::get('/', [Home\HomeController::class, 'index']);

Route::get('/{cate}.html', [Home\HomeController::class, 'cate'])->where(['cate' => '[A-Za-z0-9]*']);
Route::get('/{cate}/detail_{id}.html', [Home\HomeController::class, 'details'])->where([
    'cate' => '[A-Za-z0-9]*',
]);
Route::get('/{cate}/{id?}.html', [Home\HomeController::class, 'cate'])->where(['cate' => '[A-Za-z0-9]*']);

// 自定义渲染方式，这个方式是在所有路径没有匹配上的情况下，如存在同名模版执行
Route::fallback([Home\HomeController::class, 'render']);
